Component({
  options: {},

  data: {
    //正在播放的视频ID
    PrevideoID: ''
  },

  /* 组件的属性列表 用于组件自定义设置 */
  properties: {
    list: Object,
  },

  methods: {
    handlePlay(e) {
      let _this = this;
      let videoID = e.target.id
      console.log(videoID)
      if (_this.data.PrevideoID) {
        if (_this.data.PrevideoID != videoID) {
          console.log(_this.data.PrevideoID)
          wx.createVideoContext(_this.data.PrevideoID, this).pause()
          console.log(videoID)
          wx.createVideoContext(videoID).play()
          _this.setData({
            PrevideoID: videoID
          })
        }
      } else {
        _this.setData({
          PrevideoID: videoID
        }, () => {
          _this.setData({
            videoContext: wx.createVideoContext(String(videoID), _this)
          })
        })
      }
    },
  },
})